package com.chc.finance.sys.view;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.chc.finance.sys.bo.SecBo;
import com.chc.util.ServiceLocator;


@WebServlet(value={"/login"})
public class LoginServlet extends HttpServlet{
	private SecBo secBo;
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		secBo.test();
		req.setAttribute("name", "习哥");
		req.getRequestDispatcher("/page/home.jsp").forward(req, resp);
	}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		this.doPost(req, resp);
	}

	@Override
	public void init() throws ServletException {
		secBo=(SecBo)ServiceLocator.getInstanse(getServletContext()).getBean("secBo");
		super.init();
	}

	
	
	

}
